<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>职位列表</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <style>
    .job-card {
      transition: transform 0.3s;
      margin-bottom: 20px;
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .job-card:hover {
      transform: translateY(-5px);
    }
    .salary-highlight {
      color: #ff6b6b;
      font-weight: bold;
    }
    .badge-custom {
      background-color: #e3f2fd;
      color: #1976d2;
      margin-right: 5px;
      margin-bottom: 5px;
    }
  </style>
</head>
<body>
<div class="container py-5">
  <h1 class="text-center mb-5">热门职位列表</h1>

  <!-- 搜索筛选区 -->
  <div class="row mb-4">
    <div class="col-md-8">
      <input type="text" class="form-control" placeholder="搜索职位、公司或关键词...">
    </div>
    <div class="col-md-2">
      <select class="form-select">
        <option>所有城市</option>
        <option>北京</option>
        <option>上海</option>
      </select>
    </div>
    <div class="col-md-2">
      <button class="btn btn-primary w-100">搜索</button>
    </div>
  </div>

  <!-- 职位列表 -->
  {{ range .jobs }}
  <div class="card job-card">
    <div class="card-body">
      <div class="row">
        <div class="col-md-8">
          <h3>{{ .Title }}</h3>
          <div class="d-flex align-items-center mb-2">
            <span class="me-3">{{ .Company }}</span>
            <span class="text-muted me-3">{{ .CompanySize }}</span>
            <span class="text-muted">{{ .CompanyType }}</span>
          </div>
          <div class="mb-3">
            <span class="me-3"><i class="bi bi-geo-alt"></i> {{ .City }} · {{ .Address }}</span>
            <span class="me-3"><i class="bi bi-mortarboard"></i> {{ .Education }}</span>
            <span><i class="bi bi-briefcase"></i> {{ .Experience }}</span>
          </div>
          <div class="mb-3">
            {{ range .Benefits }}
            <span class="badge badge-custom">{{ . }}</span>
            {{ end }}
          </div>
        </div>
        <div class="col-md-4 text-end">
          <h4 class="salary-highlight">{{ .Salary }}</h4>
          <p class="text-muted">招聘人: {{ .Recruiter }} · {{ .RecruiterTitle }}</p>
          <button class="btn btn-outline-primary me-2">收藏</button>
          <button class="btn btn-primary">立即申请</button>
        </div>
      </div>

      <!-- 职位详情 (折叠内容) -->
      <div class="mt-3">
        <a class="text-decoration-none" data-bs-toggle="collapse" href="#desc-{{ .Title }}" role="button">
          <i class="bi bi-chevron-down"></i> 职位详情
        </a>
        <div class="collapse mt-2" id="desc-{{ .Title }}">
          <h5>职位描述</h5>
          <p>{{ .Description }}</p>

          <h5>岗位职责</h5>
          <ul>
            {{ range .Responsibilities }}
            <li>{{ . }}</li>
            {{ end }}
          </ul>
        </div>
      </div>
    </div>
  </div>
  {{ end }}

  <!-- 分页 -->
  <nav class="mt-4">
    <ul class="pagination justify-content-center">
      <li class="page-item disabled">
        <a class="page-link" href="#">上一页</a>
      </li>
      <li class="page-item active"><a class="page-link" href="#">1</a></li>
      <li class="page-item"><a class="page-link" href="#">2</a></li>
      <li class="page-item"><a class="page-link" href="#">3</a></li>
      <li class="page-item">
        <a class="page-link" href="#">下一页</a>
      </li>
    </ul>
  </nav>
</div>

<!-- Bootstrap JS 和依赖 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
</body>
</html>